<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="36-10-手写Promise-catch方法实现.js"></script>
</head>

<body>
    <script>
        let p = new Promise((resolve, reject) => {
            //    resolve('ok');
            reject('error');
        });

        // let p2 = p.then(undefined,undefined);
        p.then(val => {
        }, rea => {
            console.log('then内的', rea);
            return new Promise((res, rej) => {
                rej('error');
            });
        })
        .catch(rea => {
            console.log('catch内的', rea);
        })


        p.then(undefined, rea => {
            console.log('then内的', rea);
            return new Promise((res, rej) => {
                rej('error');
            });
        })

        // console.log(p2);

    </script>
</body>

</html>